define(['jquery', 'frontend/password_verified'], function ($, PasswordVerified) {
    var Controller = {
        index: function () {
            //初始化密码验证
            PasswordVerified.init();

            $(".slide span").click(function () {

                var id = $(this).attr("id");
                var img = $(this).data("img");

                $(".slide span").html("&#9675;");
                $(this).html("&#9679;");

                $(".LeftDiv img").animate({ marginTop: '-1000px', opacity: '0' }, 600, function () {
                    var html = ' <img  src="' + img + '" >';
                    $(".LeftDiv").html(html);

                    $(".LeftDiv img").css("margin-left", "600px");

                    $(".LeftDiv img").fadeIn();
                    $(".LeftDiv img").animate({ marginLeft: "0" }, 300);
                });

                $(".head-article-focus").fadeOut(100, function () {
                    $(".head-article-focus").removeClass("head-article-focus");
                    $("#article_" + id).addClass("head-article-focus");
                    $("#article_" + id).fadeIn();
                });

            });

            $(".notice-article-name").click(function () {
                var id = $(this).attr("id");
                var img = $(this).data("img");

                $(".slide span").html("&#9675;");
                $(".slide span[id='" + id + "']").html("&#9679;");


                $(".LeftDiv img").animate({ marginTop: '-1000px', opacity: '0' }, 600, function () {
                    var html = ' <img  src="' + img + '" >';
                    $(".LeftDiv").html(html);

                    $(".LeftDiv img").css("margin-left", "600px");

                    $(".LeftDiv img").fadeIn();
                    $(".LeftDiv img").animate({ marginLeft: "0" }, 300);
                });

                $(".head-article-focus").fadeOut(100, function () {
                    $(".head-article-focus").removeClass("head-article-focus");
                    $("#article_" + id).addClass("head-article-focus");
                    $("#article_" + id).fadeIn();
                });

            });
        }
    };
    return Controller;
});
